package Week3.num.week3Test1.method;

import java.util.Scanner;

public class Homework02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = sc.nextInt();
        if(judgeYear(year)){
            System.out.println("这个年份是闰年");
        }else {
            System.out.println("这个年份是平年");
        }
    }

    public static boolean judgeYear(int year) {
        //每4年为一闰年
        int num01=4;
        //年份为100的倍数时这年不一定为闰年
        int num02=100;
        //每400年为一闰年
        int num03=400;
        if (year%num01==0&&year%num02!=0&&year%num03==0){
            return true;
        }
        return false;
    }
}
